#region Copyright
/// <copyright>
/// Copyright (c) 2007 Ilia Shramko.
/// Released under the terms of the GNU General Public License.
/// </copyright>
#endregion

using System;
using System.Collections.Generic;
using System.Text;

namespace Osh
{
	public class ModeChangeEventArgs : EventArgs
	{
		private bool _cancel;
		private bool _canBeCanceled;
		private string _mode;

		public ModeChangeEventArgs(string mode, bool canBeCanceled)
		{
			_mode = mode;
			_canBeCanceled = canBeCanceled;
		}

		public bool Cancel
		{
			get { return _cancel; }
			set
			{
				if(!_canBeCanceled)
					throw new InvalidOperationException("Operation cannot be canceled.");
				_cancel = value;
			}
		}

		public string Mode
		{
			get { return _mode; }
		}
	}
}
